package com.example.demo.rabbitmq.work;

import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @author 鱼仔
 * @date 2021/7/1 4:37 下午
 * 工作模式的生产者
 */
@Component
public class WorkSender {

    @Resource
    private AmqpTemplate amqpTemplate;

    private static final String queueName = "work.test";

    /**
     * 工作模式的消息发送
     */
    public void simpleSend(String msg) {
        amqpTemplate.convertAndSend(queueName, msg);
    }
}
